#ifndef __ming_fyp_render_ShaderImpl_h__
#define __ming_fyp_render_ShaderImpl_h__

//------------------------------------------------------------------------------
// header includes
#include "fyp/render/Shader.h"

#include "fyp/core/String.h"

struct ID3DXEffect;

//------------------------------------------------------------------------------
namespace ming
{
namespace fyp
{
namespace render
{
	class TResourceFactory;

	//--------------------------------------------------------------------------
	class TShaderImpl : public IShader
	{
	public:
		//------------------------------
		// #cstor & #dstor
		TShaderImpl(const char *filename, const char *technique, TResourceFactory *resFactory);
		~TShaderImpl();
		
		//------------------------------
		// external operations
		virtual void BeginRender();
		virtual bool BeginPass();
		virtual void EndPass();
		virtual void EndRender();

		virtual void BindParam(
			const char *semantic,
			const void *value,
			size_t size);

		virtual bool HasParam(const char *semantic);
		
		virtual void CommitParams();

	private:
		//------------------------------
		// internal attributes
		TResourceFactory *mResFactory;
		ID3DXEffect *mEffect;
		TStr mTechnique;
		unsigned int mPassCnt;
		unsigned int mCurrPass;
		
		//------------------------------
		// internal operations
	};
	
	//--------------------------------------------------------------------------
}
}
}


#endif	//__ming_fyp_render_ShaderImpl_h__